var $ = getApp(), methods = require("../methods.js");
Page(Object.assign({}, methods, {
	data: {
		show:false,
		count0: 0,
		count1: 0,
		count2: 0,
		count4: 0,
		userinfo: [],
		userlevel: [],
		sysset: [],
		isload: 0,
		loginshow: 0
	},
	_onLoad(){
		var that = this
		$.get($.pre_url+'/am.php?s=/index/index', {}, function (res){
			res.show = true
			res.session_id = $.config.session_id
			that.setData(res)
		});
	},
	switchchange:function(e){
		console.log(e)
		var field = e.currentTarget.dataset.type;
		var value = e.detail.value ? 1 : 0;
		$.post($.pre_url+'/am.php?s=/index/setusertmpl',{field:field,value:value},function (data){})
	},
	saoyisao:function(d){
		var that = this;
		wx.scanCode({
			success:function(res){
				console.log(res)
				var content = res.result;
				$.goto(content + '/session_id/'+that.data.session_id+'/fromwx/1');
			}
		})
	}
}))